<template>
    <transition>
        <div class="language-box">
            <header class="mui-bar mui-bar-nav mui-bar-transparent" :class="isImmersed()?'immerse-margin':''">
                <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @click="myBackRoute()"></a>
                <h1 class="mui-title">{{ title }}</h1>
            </header>
            <Loading></Loading>
        </div>
    </transition>
</template>
<script>
    /* eslint-disable */
    export default {
        name: 'webview',
        created() {
            this.url = this.$route.query.url;
            this.title = this.$route.query.title;

            this.webviewLoad();
        },
        mounted() {
            this.$store.dispatch("aBackUrl", "/index/my");
        },
        data() {
            return {
                url: "",
                title: "",
            }
        },
        methods: {
            webviewLoad: function () {
                if (typeof plus != "undefined") {
                    // let waiting = plus.nativeUI.showWaiting("加载中...");
                    plus.webview.open(this.url, "about-me-link", {top: "59px"}, "none", 200, function () {
                        // waiting.close();
                    });
                }
            },
            myBackRoute: function () {
                let ws = plus.webview.getWebviewById("about-me-link");
                ws.close();
                this.changeRoute("/my/about");
            }

        }
    }
</script>
<style scoped>
    .language-box > header {
        background: #FAFBFC;
    }

    .language-box .mui-bar-nav {
        box-shadow: none;
        border-bottom: 1px solid rgba(204, 204, 204, .2);
    }

    .language-box .mui-pull-left {
        color: #000;
    }

    .language-item li {
        font-size: .3rem;
        padding: 18px 15px;
    }
</style>